﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO.InnerAttribute;
using System.Runtime.Serialization;

namespace DTO
{
    /// <summary>
    /// 账户
    /// </summary>
    [DataContract(Name = "Card", Namespace = "")]
    public class Card
    {
        public Card()
        {
            //序列化方便初始化时将时间初始化为最小值
            BillDate = DateTime.MinValue.AddDays(1);
            DueDate = DateTime.MinValue.AddDays(1);
        }
        [DataMember(Name = "CID", Order = 1)]
        public int CID { get; set; }
        /// <summary>
        /// 账户名称
        /// </summary>
        [DataMember(Name = "Title", Order = 2)]
        public string Title { get; set; }

        [DataMember(Name = "AID", Order = 3)]
        public int AID { get; set; }
        /// <summary>
        /// 账户资金
        /// </summary>
        [DataMember(Name = "Money", Order = 4)]
        public decimal Money { get; set; }
        [DataMember(Name = "Type", Order = 5)]
        public CardType Type { get; set; }
        /// <summary>
        /// 说明
        /// </summary>
        [DataMember(Name = "Description", Order = 6)]
        public string Description { get; set; }
        /// <summary>
        /// 卡号
        /// </summary>
        [DataMember(Name = "CardNumber", Order = 7)]
        public string CardNumber { get; set; }
        /// <summary>
        /// 账单日
        /// </summary>
        [DataMember(Name = "BillDate", Order = 8)]
        public DateTime BillDate { get; set; }
        /// <summary>
        /// 结算日
        /// </summary>
        [DataMember(Name = "DueDate", Order = 9)]
        public DateTime DueDate { get; set; }
        /// <summary>
        /// 信用额度
        /// </summary>
        [DataMember(Name = "CreditLine", Order = 10)]
        public decimal CreditLine { get; set; }
        /// <summary>
        /// 组织机构（银行）ID
        /// </summary>
        [DataMember(Name = "OrganizationID", Order = 11)]
        public int OrganizationID { get; set; }
    }

    /// <summary>
    /// 账户类型
    /// </summary>
    public enum CardType
    {
        /// <summary>
        /// 现金类型账户
        /// </summary>
        [Display("现金")]
        Cash=1,
        /// <summary>
        /// 借记卡
        /// </summary>
        [Display("借记卡")]
        DebitCard=4,
        /// <summary>
        /// 信用卡
        /// </summary>
        [Display("信用卡")]
        CreditCard=2,
        /// <summary>
        /// 股票账户
        /// </summary>
        [Display("股票账户")]
        StockCard=3
        

    }
    
}
